// 导入request.js请求工具
import request from '@/utils/request.js'

// ================== 景点相关接口 ==================
// 获取附近景点
export const getNearbyAttractions = (lng, lat) => {
  return request.get('/api/getNearbyAttractions', {
    params: {
      lng: lng,
      lat: lat
    }
  })
}

// 获取景点详情
export const getAttractionDetail = (id) => {
  return request.get(`/api/getAttractionDetail/${id}`)
}

// 获取天气信息

export const getWeather = (location) => {
  return request.get('/api/getWeather', {
    params: { location: location }
  });
};

// 获取景点评论
export const getAttractionReviews = (id) => {
  // eslint-disable-next-line no-undef
  return instance.get(`/api/getAttractionReviews/${id}`);
};